Copyright 1995-1996 Doug Anderson (dianders@cs.stanford.edu)
Postcard-ware
Motto: メYou shouldnユt need to understand an AppleScript to use it...モ
Description:
Batch FTP is a script for Peter Lewis' Anarchie program. It allows a user to batch-download a list of files (such as one generated from a new or recent files list) from an FTP server. Before you dismiss this script with others of it's kind, read on...it has some features I haven't see elsewhere.
Features:
・ Handy: Files to be downloaded don't need a full path. You can specify one base path that will apply to all files in the list.
・ Smart: Automatically retries minor errors.
・ Customizable: Remembers the base paths for up to 4 of your favorite sites.
・ Easy: Options to use the preferred info-mac or umich sites specified by Internet Config
Requirements:
・ Applescript (tested with version 1.1): from Apple.
・ Anarchie (tested with version 1.6): ftp://ftp.share.com/pub/peterlewis/
・ Included scripting additions (see below)
・ Included Progress Bar Application (optional, see below)
Included:
・ DialogRunner 1.0: Obtained from Tao of AppleScript
・ Progress Bar 1.0.1: /info-mac/dev/osa/progress-bar-101.hqx
Step-by-step Instructions:
First, install the included scripting additions. To do this, open the extensions folder inside your System Folder. Inside the extensions folder, drop the contents of the "Add to Scripting Additions" folder into the scripting additions folder. You don't have to restart.
Next, use a text editor (like SimpleText, TexEdit) to generate your list of files. I ususally copy file names from lists provided by a server, such as the new files list of umich or info-mac. Each file should be separated by a return.
Save the list as a text file, and then drag it onto the Batch FTP icon.
If your file list is from Umich or Info-Mac, choose one of the first two base paths. Otherwise, enter a base path in one of the four slots below and choose its radio button. The base paths in the four slots are saved between BFTP runs for convience.
・ Choosing "Preferences..." will allow you to choose whether BFTP uses a progress bar and also to control whether it logs its actions.
When you've done with the dialog box, hit "OK". BFTP will load Anarchie and start downloaing files. If it gets an error while receiving, it will attempt to act intelligently. If it knows that the error is easily recoverable (a minor error), it will retry forever. If it doesn't know about the error or the error is more serious, it will retry a few times and then give up. If the error is critical, it will not retry.
Tips and Tricks
・ If you drop more than one file onto Batch FTP, it will prompt you to enter the base paths for the files one at a time (it tells the filename it's currently working on in the dialog box). After it's done with all the prompting, BFTP will start downloading one file after the other.
・ If you want to stop BFTP while it's running, make sure that the script is the front-most application and hit "Command-." You will be able to either skip the current URL, or stop BFTP alltogether.
・ I generate my info-mac files lists by downloading the recent-files list, loading it up with Tex-Edit, creating a new window, and then drag-dropping the files I want to download into the new window (making sure that I highlighted the return). This is a fast and easy way to prepare files for BFTP.
TroubleShooting
Problem: BFTP Doesn't work with Text Clippings
That's not a bug, that's a missing feature. Although I would love to handle text clippings, I can't becaues I don't have a scripting addition that will let me read them. Sorry!
Problem: Anarchie isn't responding correctly to BFTP
Make sure that you have the newest version of Anarchie. At the writing of this documentation, this version is 1.6.0. It can be obtained at the address listed at the top of this document.
Problem: BFTP doesn't work when I run it from "Script Editor"
BFTP is only designed to be run as an application. It will not work at all if you load it into Script Editor and press "run." If you want to modify BFTP, you must make your modifications, save it, and then run the actual application. (Sorry...I have to do this too. There's no way around it that I can see).
Problem: "BFTP MAIN" doesn'tunderstand the <event DRund> or similar error
One of your scripting additions (in this case Dialog Runner) wasn't installed properly. Make sure that you took all of the items from the "Add to Scripting Additions" folder and put them in the "Scripting Additions" folder in your "Extensions Folder."
Problem: BFTP keeps asking me to locate Progress Bar, but I deleted it because I didn't use it.
BFTP likes to know where things are even if it probably won't use them. Because BFTP has the option of using Progress Bar, it has to know where the application is. If you don't like Progress Bar, you have two options:
1. Leave it on your machine anyway. The application itself is only 30k.
2. When BFTP asks you to locate Progress Bar, choose some other application (even BFTP itself will work). NOTE: only do this if you're sure you will never use Progress Bar. If you change your mind after this, you must re-install BFTP or edit the script manually.
General Troubleshooting:
1. Make sure AppleScript is installed.
2. Make sure all required scripting additions are in the Scripting Additions folder in the Extensions folder.
3. Make sure Anarchie works on it's own. If it doesn't, try to get it to work first.
Known Bugs / Problems
・ There is a report that Autodoubler is incompatible with BatchFTP. The fix is to tell Autodoubler not to compress BatchFTP. Since I don't have Autodoubler, I have no way of testing this, but be warned.
・ When BFTP quits, it also quits Progress Bar. If Progress Bar was being used by some other script, things may go haywire.
Payment Info:
This script is Postcard-ware. That means that if you use BFTP, you are supposed to send me a postcard (see Contacting the Author for address). I've spent a lot of time working on BFTP. It's nice to know that I'm not doing it for nothing. If a postcard is too expensive for you, e-mail is ok (but not nearly as nice as seeing something in my mailbox).
Contacting the Author:
If you have suggestions, comments or just want to drop me a note, feel free to e-mail me at dianders@cs.stanford.edu. Also, please send me a postcard to:
Doug Anderson
PO Box 3506
Stanford, CA 94309
Legal Junk:
Non-profit companies and individuals may use and distribute BFTP freely. However, I still retain the copyright. Any for-profit company planning to distribute Batch FTP must contact me and obtain permission. Although I don't anticipate any trouble, I should say that I take no responsibility for any actions this script takes.
Progress Bar 1.0.1 is ゥ 1993 Gregory H. Dow, distributed with permission. Please see accompanying documentation for more details.
DialogRunner and ResMover are ゥ 1993 Chris Reed. Please see accompanying documentation for more details. Although I only use DialogRunner, the documentation specifies that they both must be distributed at once. I am distributing this package without permission because I have been unable to contact the author by e-mail.
Thanks To:
Gaspard Gendreau (Gaspard.Gendreau@esrin.esa.it) made some modifications to the script to have it use Anarchie's default info-mac server. I based some of the script on his modifications.
Version History:
2.50 - Public Release 8/13/96. No changes from 2.50b (I think my beta testers fell asleep again!)
2.50b - Re-worked a lot of things in Batch FTP (again). Changes:
・ Batch FTP is no longer freeware. It is now Postcard-ware. Please, please, please: if you use BFTP, send me a postcard (my address is in Contacting the Author). See Payment Stuff for more pleas.
・ Batch FTP is not asynchronous any more (I've reverted back to the way I used to do it). In other words, that means that I don't have an event loop. I just do everything right after another. I've decided that the trouble of the event loop wasn't worth it. Anyway, that means you can't add files to BFTP after it's already started, but it also means that BFTP responds faster, doesn't get corrupted as easily, and generally is more stable.
・ Removed "Choose..." option that lets you choose from Anarchie's bookmarks. I have a feeling that it was never used, and it was making the code more complex than it had to be.
・ File lists are now processed from top to bottom, instead of bottom to top.
・ Reworked Progress Bar stuff. It's now faster and better looking.
・ Major renovatioin of error-handling. Added the concept of "minor/major/critical" errors. Now, handles errors that BFTP doesn't know about better.
・ Added logging of errors.
・ Added preferences sub-dialog. Lets you set whether to use the progress bar, and also logging options.
・ Major code-cleanup. An outside reader might be able to understand a thing or two now. Code is also more extensible (yeah, I'm planning for the future...)
2.01 - Choosing not to use the Progress Bar now works (doh!)
2.00 - Public Release 12/12/95. No changes from 2.00b (amazingly, there were no bugs!)
2.00b - Re-worked a lot of the code of Batch FTP. Changes:
・ Batch FTP now has a new, better dialog. The new dialog is easier to use, and also allows storage of 4 custom sites in addition to the preset info-mac and umich sites. The new dialog uses the included DialogRunner addition. Note: Jons Commands was included previously only for use in the old dialog. Because it is no longer needed, I have stopped distributing it.
・ You can have Batch FTP keep you informed with the Progress Bar application.
・ Batch FTP now does all of it's work in "idle" mode. The good news: You should be able to queue up jobs for Batch FTP to process. While it's working, simply drag-drop another text file onto it, and ***after it completes its current file*** it should allow you to choose a base path for the next file (see Tips and Tricks). The bad news: Batch FTP only works as an application now because I can only trap for "idle" and "quit" if BFTP is an application.
・ Re-wrote a bunch of the documentation...Hope it's clearer now.
・ Updated the "vers" resource with Resedit (oops). The "vers" resource in version 1.2 still said 1.0.
1.20 - Public Release 9/23/95. Option-clicking the "OK" button now lets you choose an anarchie bookmark without assigning it to a button. I think this makes it a little more useful. Batch FTP now accepts the phrase "info-mac" as a valid base path. This makes Anarchie use your default info-mac server as the base path (based on modifications made by Gaspard Gendreau).
1.11 - Changed set to copy in a few places (I think this is faster). Started using "fetch url" instead of "geturl" for no real reason.
1.10 - First public release of Batch FTP. Added ability to read Anarchie Bookmark file.
1.00 - Finally felt that Batch FTP was ready for release. Added ability to change button names/URLs without editing the script itself, etc.
To Do:
・ Allow for password / user name. This is high priority...although I haven't figured out how to do the interface yet.
・ Delay options, like: time-delay; open /close PPP on start / end; open / chose Anarchie.
・ Option to delete the file from server after done.
・ Option of using Fetch 3.0 insead of Anarchie (I think Fetch 3.0 is scriptable, but I haven't checked yet).
・ Give BFTP a prefs file, so when you upgrade you don't lose your old preferences.
・ Recursive directory copy. I actually implemented this, but it turned out to be very hairy, and also unstable. I think I'll wait until Anarchie gives me better support before doing this (Anarchie really makes it a pain)
・ Ability to use BFTP to mirror directories. There is currently a script out there to do this, but last time I looked, you needed to know AppleScript to use it. Also, this would require Recursive directory copy, which I also won't do.